package edu.rakovic.elearning.util;

import edu.rakovic.elearning.interfaces.User;
import edu.rakovic.elearning.service.Users;

public class Security {
	
	public static User authenticate(String userName, String password, Users users)
    {
    	User login = null;
    	
    	// user name & password check
    	login = users.retreiveSingleUser(userName);
    	if (login == null) return null;
        if (login.getPassword().equals(password))
        {
            return login;
        }
        return null;
    }

}
